#!/usr/bin/python
from pylab import *

# memmap data is a multidimensional array
# memmap_data = np.random.random_sample((5,10))*4 # random seq with 5 row 10 column
memmap_data = np.random.random_sample((10,20))*4 # random seq with 5 row 10 column
# memmap_data = np.floor(memmap_data)
colors_str = 'bgry'
width = 10
height = 5

rows, cols = memmap_data.shape


def drawRect(x,y,width,height, color):
    # plot([x,x,x+width,x+width], [y-height,y,y,y-height], 'r')
    fill([x,x,x+width,x+width], [y-height,y,y,y-height], color, edgecolor='white')

for row in range(rows):
    for col in range(cols):
        drawRect(col*width, -row*height, width, height, colors_str[int(memmap_data[row][col])])

        
show()
    
